//---------------------------------------------------------------------------- // File: C3DMath.h // Class: // Type: 3D API System Managment // Author: Ken Anderson // Date: 11/26/04 // OS dependant: N/A // Desc: Provides quick mathematical definitions. // // Required headers: //---------------------------------------------------------------------------- #define C3D_PI ((float)3.141592654f) #define C3DRadian ((float)57.295f) #define C3DRadianToDegree(r) ((r) * (180.0f / C3D_PI)) #define C3DDegreeToRadian(d) ((d) * (C3D_PI / 180.0f)) //Change the alpha value (a Byte) of a Dword color value without impacting the color value. #define C3DAlphaARGB(A,ARGB) {ARGB = (A << 24) | (((Dword)(ARGB << 8)) >> 8);} //Change the color value (a Dword) of a Dword color value without impacting the alpha value. #define C3DColorARGB(RGB,ARGB) {ARGB = (RGB | ((Dword)((Byte)(ARGB >> 24))<<24));}